﻿using System.ComponentModel;

namespace S.Archives.Infrstructre
{
    public interface IBaseRepository<T>
    {
        bool Add(T t);

        bool Delete(int id);

        bool Update(T t);

        IQueryable<T> GetAll();

        #region 异步增删改查
        Task<bool> AddAsync(T t);
        Task<bool> DeleteAsync(int id);

       
        Task<bool> UpdateAsync(T t);
        Task<List<T>> GetAllAsync();
        Task<bool> UpdateRangeAsync(IEnumerable<T> entities);
        Task<bool> AddRangeAsync(IEnumerable<T> entities);

        Task<bool> RemoveRangeAsync(IEnumerable<T> entities);
        #endregion
    }
}